//
//  HangbanHeadview.swift
//  旅航ios
//
//  Created by tulip on 2021/5/6.
//

import UIKit

class HangbanHeadview: UIView {
    
    var add1:UILabel!
    var add2:UILabel!
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        let back=UIButton.init(frame: CGRect(x: 0, y:StatusBarHeight + 13, width: 39, height: 17))
        back.setImage(UIImage(named: "back-1"), for: .normal)
        back.addTarget(self, action: #selector(popback), for: .touchUpInside)
        self.addSubview(back)
        
        let img=UIImageView.init(frame: CGRect(x: SCREEN_WIDTH/2.0-4, y: StatusBarHeight+21, width: 8, height: 3))
        img.image=UIImage(named: "特价机票-箭头")
        self.addSubview(img)
        
        add1=UILabel.init(frame: CGRect(x: SCREEN_WIDTH/2.0-10-150, y: StatusBarHeight+13, width: 150, height: 18))
        add1.textAlignment = .right
        add1.textColor=UIColor.init(hexString: "333333")
        add1.font=UIFont.systemFont(ofSize: 18)
        self.addSubview(add1)
        
        add2=UILabel.init(frame: CGRect(x: SCREEN_WIDTH/2.0+10, y: StatusBarHeight+13, width: 150, height: 18))
        add2.textColor=UIColor.init(hexString: "333333")
        add2.font=UIFont.systemFont(ofSize: 18)
        self.addSubview(add2)
    }
    
   
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setAddress1(address1:String,address2:String){
        add1.text=address1
        add2.text=address2
    }
    
    @objc func popback(){
        getCurrentVc().navigationController?.popViewController(animated: true)
    }
}
